var e = require("../../../uv-ui-tools/libs/mixin/mpMixin.js"), t = require("../../../uv-ui-tools/libs/mixin/mixin.js"), i = require("./props.js"), n = require("../../../../common/vendor.js");

require("../../../uv-ui-tools/libs/function/index.js"), require("../../../uv-ui-tools/libs/function/test.js"), 
require("../../../uv-ui-tools/libs/function/digit.js"), require("../../../uv-ui-tools/libs/util/route.js"), 
require("../../../uv-ui-tools/libs/function/debounce.js"), require("../../../uv-ui-tools/libs/function/throttle.js");

var r = {
    name: "uv-form-item",
    emits: [ "click" ],
    mixins: [ e.mpMixin, t.mixin, i.props ],
    data: function() {
        return {
            message: "",
            parentData: {
                labelPosition: "left",
                labelAlign: "left",
                labelStyle: {},
                labelWidth: 45,
                errorType: "message"
            }
        };
    },
    created: function() {
        this.init();
    },
    methods: {
        init: function() {
            this.updateParentData(), this.parent || this.$uv.error("uv-form-item需要结合uv-form组件使用");
        },
        updateParentData: function() {
            this.getParentData("uv-form");
        },
        clearValidate: function() {
            this.message = null;
        },
        resetField: function() {
            var e = this.$uv.getProperty(this.parent.originalModel, this.prop);
            this.$uv.setProperty(this.parent.model, this.prop, e), this.message = null;
        },
        clickHandler: function() {
            this.$emit("click");
        }
    }
};

Array || (n.resolveComponent("uv-icon") + n.resolveComponent("uv-transition") + n.resolveComponent("uv-line"))(), 
Math || (function() {
    return "../../../uv-icon/components/uv-icon/uv-icon.js";
} + function() {
    return "../../../uv-transition/components/uv-transition/uv-transition.js";
} + function() {
    return "../../../uv-line/components/uv-line/uv-line.js";
})();

var o = n._export_sfc(r, [ [ "render", function(e, t, i, r, o, a) {
    return n.e({
        a: e.required || e.leftIcon || e.label
    }, e.required || e.leftIcon || e.label ? n.e({
        b: e.required
    }, (e.required, {}), {
        c: e.leftIcon
    }, e.leftIcon ? {
        d: n.p({
            name: e.leftIcon,
            "custom-style": e.leftIconStyle
        })
    } : {}, {
        e: n.t(e.label),
        f: n.s(o.parentData.labelStyle),
        g: n.s({
            justifyContent: "left" === o.parentData.labelAlign ? "flex-start" : "center" === o.parentData.labelAlign ? "center" : "flex-end"
        }),
        h: e.$uv.addUnit(e.labelWidth || o.parentData.labelWidth),
        i: "left" === o.parentData.labelPosition ? 0 : "5px"
    }) : {}, {
        j: n.o(function() {
            return a.clickHandler && a.clickHandler.apply(a, arguments);
        }),
        k: n.s(e.$uv.addStyle(e.customStyle)),
        l: n.s({
            flexDirection: "left" === (e.labelPosition || o.parentData.labelPosition) ? "row" : "column"
        }),
        m: !!o.message && "message" === o.parentData.errorType
    }, o.message && "message" === o.parentData.errorType ? {
        n: n.t(o.message),
        o: e.$uv.addUnit("top" === o.parentData.labelPosition ? 0 : e.labelWidth || o.parentData.labelWidth),
        p: n.p({
            show: !0,
            duration: 100,
            mode: "fade"
        })
    } : {}, {
        q: e.borderBottom
    }, e.borderBottom ? {
        r: n.p({
            color: o.message && "border-bottom" === o.parentData.errorType ? "#f56c6c" : "#d6d7d9"
        })
    } : {});
} ], [ "__scopeId", "data-v-f0f43575" ] ]);

wx.createComponent(o);